(a) Field of the Invention
The present invention generally relates to a transfer network used in electrical systems for the selective enhancement of a given class of input signals, and more particularly to a digital filter for filtering an M-by-M pixels matrix of a two-dimensional digital image in a filter having an N-by-N (N&lt;M) filter length while raster-scanning the matrix.
(b) Description of the Prior Art
Generally known for filtration of a digital image are three types of filters. The first is a high-pass filter that eliminates or attenuates all frequencies lower than a given cutoff frequency, resulting in substantial enhancement of all other frequencies above the cutoff frequencies. Another is a low-pass filter to enhance all frequencies below a given cutoff frequency while substantially eliminating or attenuating all other frequencies above the cutoff frequency. The third type of filter is a band-pass filter that eliminates or attenuates all frequencies both below and above a given band pass, resulting in a substantial enhancement of the band of frequencies of interest. These filters are used for adjusting the quality of a digital image for any intended purpose of the image. For example, in the field of medical imaging, the purpose of such an image exists in the medical diagnosis of an object under examination. In this field of technique, the filtration is done for improvement of the image quality to thus facilitate diagnosis. A digital image is yielded from a combination of differential densities in quantized two-dimensional spaces called "pixels". Digital filtration of a digital image consisting of, for example, M-by-M pixels will be explained below with reference to FIG. 1.
FIG. 1 depicts an image data consisting of M-by-M pixels. Assume here that data D (I, J) at each pixel point (I, J) is to be filtered. For simple filtration, there is available a method of convoluting the data D (I, J) and its surrounding data, which is expressed as (1) below: ##EQU1## where D (I, J) is an image datum at the coordinate point (I, J), N is an odd number and the symbol [ ] represents the Gaussian operation, i.e., the emission of digit below the first decimal place. In case N is an even number this filtration is carried out approximately as follows: ##EQU2##
It should be noted that the following description about filtration is based on the expression (1) where N is an odd number, since the differences among the above-mentioned cases are not essential in the present invention. A weight function W for each of all N.sup.2 data in an area of N by N is multiplied by its respective datum, and the products thus obtained are summed. The result is divided by N.sup.2 and added to the orginal data D, thus yielding a fitration result Q (I, J). The image quality thus attained with the filtration result Q (I, J) is adjusted according to the characteristic of the weight function W in the right side of the expression (1) and the area size N of that weight function as well. By this method of filtration, the expression (1) leads to a number of multiplications and additions-that is M by M by N by N. Thus, this method necessitates a large number of calculations, which is not practical. To avoid this, the expression is further simplified for the purpose of the digital filtration. With the assumption that the W (k, l) in the expression (1) has a constant value, the following expression (2) is given: EQU W(k, l).tbd.K (2)
where K.gtoreq.-1. Thus, the expression (1) for the filtration is given as follows: ##EQU3## Since the expression omits the multiplication from the necessary multiplication and summing for the expression (1) and the filtration can be effected with only addition, the number of calculations can be reduced.
In the right side of the expression (3), all N.sup.2 data in an area of N by N around the coordinates (I, J) are added together, and the total sum is divided by N.sup.2 for a mean value of the N-by-N data. The mean value is multiplied by a constant K that is a weight factor for the mean value. Thus, in the right side of the expression (3), a value obtained from the multiplication of the mean value by the weight factor K is added to the data D (I, J) at the coordinate point (I, J). The value Q (I, J) thus obtained is a filtration of the data D (I, J) at the point (I, J).
The filtration based on the expression (3) will be explained below.
FIG. 2 (A) shows a filtration weight function W.sub.0 of a width N. The power spectrum F(.omega.) of this function W.sub.0 is shown in FIG. 2 (B). As seen in FIG. 2 (B), the power spectrum F(.omega.) has a maximum value at a point of .omega.=0 while being zero at points of .+-.1/N, and is attenuated repeatedly in the directions of .+-..omega.. Therefore, the convolution by the weight function W.sub.0, that is, the averaging of N data, provides for a low-pass filtration; namely, low spatial frequencies near the zero point are passed as they are, while original data of increasingly higher frequencies are more strictly inhibited from being transmitted. At the points of .+-.1/N, no frequencies are transmitted. For this reason, higher frequencies are transmitted when N is smaller, but as N is larger, no higher frequencies are passed. Thus, the frequency response of filtration can be varied according to the magnitude of N.
According to the expression (3), a result of the operation in FIG. 2 (B) is added in a factor K to an original data D (I, J). When the K takes a positive value, low-pass filtration takes place, while the K being negative leads to high-pass filtration. Thus, a desired image quality is obtainable by setting appropriate magnitudes of N and K. Examples of filtrations when the K is negative, namely, examples of high-pass filtrations, are shown in FIGS. 3 (A) and (B).
FIG. 3 (A) shows change in spatial frequency filtration with K=-1 and different values of N, while FIG. 3 (B) shows changes in spatial frequency filtration with K=-1/2 and different values of N. As shown, with a large setting of N (as shown by the direction of arrow N.sub.L), the bandwith as a whole decreases, with the frequency response having a steep slope. Setting N small (as shown by the direction of arrow N.sub.S) leads to an increase in bandwith so that the frequency response represents a gentle slope. Further, by altering the factor K, it is possible to change the extent of blocking the low frequencies. As shown in FIGS. 3 (A) and (B), the filter characteristic, or the power spectrum F(.omega.) of filtration weight function W.sub.0, is greatly reduced in the domain of low frequencies, while such reduction is small is the domain of high frequencies. Thus, a high-pass filtration can be achieved. By altering the K and N parameters, it is possible to adjust the filter characteristic for a desired image quality.
FIG. 3 (C) depicts the characteristic curves of a high-pass filter with the N value kept constant and K altered. As the K value is removed from zero, the rising slope is steeper, which indicates a good high-pass filter characteristic. FIG. 3 (C) also shows the characteristic curves l.sub.1, l.sub.2 and l.sub.3 when K=-1 while N is altered with the assumption that N values for the characteristic curves l.sub.1, l.sub.2 and l.sub.3 are N.sub.1, N.sub.2 and N.sub.3, respectively, N.sub.1 &gt;N.sub.2 &gt;N.sub.3.
FIG. 4 (A) shows the characteristic curves of low-pass filtration with the K value being infinite while the N value is altered. As the N value is increases, the falling slope is correspondingly steeper. FIG. 4 (B) depicts the characteristic curves with the N value kept constant while the K value is altered. With the K value being greater, the falling slope is much steeper. FIG. 3 (C) and FIGS. 4 (A) and (B) show characteristic curves of filtration with the frequency .omega. being positive. With a negative .omega. value, symmetrical curves will be seen.
The calculation of the expression (3) necessitates N-by-N=N.sup.2 additions as shown at the second term of the right side thereof. Further, the expression (3) has to be calculated for M-by-M=M.sup.2 pixels. Therefore, filtration of one image necessitates N.sup.2 -by-M.sup.2 additions. For an image used for diagnosis of a subtle diseased tissue of a patient, such as an X-ray image, the M and N are selected to be 1000 to 4000 and 100 to 250, respectively, and so the number of such additions is 10.sup.10 to 10.sup.12, which leads to a large amount of time for digital filtration using the expression (3). Heretofore, a large-scale processor was used or the N value was set to a small one for reduction of the N.sup.2 value (number of additions), in order to lessen the time needed for digital filtration.